/**
 * Description:
 * Author:    Dane
 * CreateTime:2024/8/20-下午4:56
 * Since  :   1.0
 * Version:   1.0
 */
public class Link <E>{
    int size=0;
    Node header;

    public void add(E data){
        if (header==null) {
            header=new Node(data,null);
        }else {
           Node currentLastNode= findLastNode(header);
              currentLastNode.next=new Node(data,null);

        }
    }

    private Node findLastNode(Node node) {
        if (node.next==null) {
            return node;
        }
       return findLastNode(node.next);

    }


}
